perm filename DEBUG.LOG[TEX,DEK] blob sn#656187 filedate 1982-05-01 generic text, type C, neo UTF8
COMMENT ⊗   VALID 00024 PAGES
C REC  PAGE   DESCRIPTION
C00001 00001
C00003 00002	****** The Log of TEX Bugs ******
C00008 00003	* March 10 (1978)
C00012 00004	* March 12
C00017 00005	* March 14 (Came in evening, slept most of day, to get computer at better time)
C00022 00006	* March 16, 9pm
C00027 00007	* March 18 (Saturday), 3:30pm
C00030 00008	* March 19
C00034 00009	* March 20, 8pm
C00038 00010	* March 21, 10pm
C00042 00011	* March 22 (Wednesday)
C00044 00012	* Maundy Thursday March 23, 11pm
C00049 00013	* Easter Sunday March 26, will work till sunrise
C00053 00014	* March 29 (Wednesday), beginning 2:30am
C00056 00015	Summary of initial debugging stage:
C00057 00016	* April 1
C00061 00017	* May 23
C00065 00018	* June 18
C00069 00019	* July 28 (while writing Chapter 27 of the manual)
C00073 00020	* September 30
C00076 00021	* January 16 (1979)
C00079 00022	* July 1
C00083 00023	* January 25, 1980
C00086 00024	* June 13 (Begin overhaul of justification routine and miscellaneous goodies)
C00094 ENDMK
C⊗;
****** The Log of TEX Bugs ******

This file contains notes about essentially all the changes made to TEX since
it first compiled without syntax errors in March, 1978.

At that time, nothing had been debugged (or even loaded, much less executed),
although the program had been written sporadically starting in September of 1977.
(Exception: The hyphenation module was based on a program that had been the
subject of numerous experiments and seemed to be working satisfactorily.)

Each change has been classified into one of the following twelve categories:

B, a blunder or slip (I knew what I wanted to do, but I wrote something else
	that was syntactically correct; sort of a mental typo).
D, an incorrect update to the data structures (I failed to fill in some fields
	according to the rules).
E, an improvement made for the sake of efficiency (although the inefficient
	version would have run correctly).
F, a forgotten case or operation (where the program is supposed to do more things or
	handle more cases than I had remembered to code when I wrote that part).
G, a change that adds to the generality of TEX (usually an extension that suddenly
	became desirable, but sometimes merely a change in syntactic sugar).
I, an improvement to the interactive use of TEX (including error messages and
	error recovery as well as diagnostic aids for myself).
L, a change necessary because of my misuse or misunderstanding of the
	SAIL language or the DEC10 hardware.
M, a mismatch between some procedure and its call (different conventions being
	assumed in different places).
P, an improvement to the program organization or documentation, not visible
	to the user.
R, added robustness (error recovery that is mandatory to keep the program
	from looping or crashing).
S, an unpleasant surprise that made me change the original idea of some
	algorithm or data structure.
T, a typographical error (made while entering the program into the machine,
	not caught as a syntax error).

Categories B, D, F, L, M, R, S, T are "bugs", while categories E, G, I, P are
enhancements to the language and conveniences for its users.

Besides these classifications, each change also has a serial number. For example,
M64 is change number 64, and it belongs to category M (mismatch). Some changes
are directly related to previous ones; this is indicated by a notation like
"F100→97", which means that change 100 is of category F and that it wouldn't have
been necessary if change 97 had been done correctly.

Some of the errors were of course more devastating than others; some of the
changes were far-reaching, others were just minor twiddles. Several actual
changes might correspond to a single entry in this log, since a single
type of error or extension may be reflected in many parts of the code.

Comments are sprinkled in with the list of changes, to record some of the
milieu in which debugging took place.
* March 10 (1978)
L1	Had to edit so that all external variables distinguished by first 6 letters
G2	Initialized escapechar to -1, not 0, and put this into initin routine
L3	In test "if id < '200", id was negative so the test succeeded [in idlookup]
B4	In test "if((t←hash[..]) ≠ 0 and ...) or ..." I had meant to say
		"if(t←hash[..]) ≠ 0 and (... or ...)" [idlookup]
P5	Made TEXPRE call initin, to make it resilient to internal errors
E6	Decided that TEXPRE should not initialize mem[..]
P7	Changed "newline" to "nextline" to avoid name conflict
F8	Forgot to include "mem[p] ≠ 0 and" in showmem
D9	I had changed macrodef but forgot to change eqdefine and (especially)
		eqdestroy with respect to curlev field conventions
## About 6 hours today.
## TEXPRE appears to work, and the test routine got through require, chcode,
	getnext, and backinput the first time.

* March 11
I10	Inserted space before ( in typeout to user while scanning a new file
F11	Forgot "p←link(p)" in loop of dumplist, so it looped forever
D12	The last item of macrodef (and also in scantoks) wasn't shifted into
		the info field, it was left in the lnk field
D13→12	(I fixed that error improperly at first, shifted by cmdd+infod not infod)
I14	Decided to add feature that prints warning when end of page occurs within
		a macro definition or call
## Unintended bugs in my test routine (acphdr) helped check out the
	error recovery mechanisms.
## For example, I had "\lft{#}" instead of "\lft{##}" inside a macro,
	and three cases of improper { and } nesting.
F15	Forgot the case "[font]" in eqdestroy
G16	Decided to change "\require" to "\input"
F17	Forgot to include the case curcmd=0 when scanning a tokenlist
## That was the first "big" error I found.
I18	Decided to put "bail" option in the error routine
L19	Couldn't say "prevdepth←flag" since prevdepth is type real, changed to pflag
I20	Improved output format of dumpnodelist slightly
F21	Caught a place in dumpnodelist where v wasn't set, so moved it outside
## About seven hours today.
* March 12
## One hour to enter yesterday's corrections and recompile.
## At this point TEX correctly located further unintended syntax errors in acphdr.
I22	Decide to put "bail" into quit, giving a chance to look
		before the system dies
F23	Forgot eqdestroy in one case of unsave
L24	Had to change "t ← (t-1) mod 8" to "t ← (t-1) land 7" in idname,
		since SAIL has -1 mod 8 = -1
S25	Found that a space appears at end of paragraph: hadn't anticipated that
L26	When <cr> is response to inchrw, a <lf> needs to be thrown away
		[in error recovery routine]
B27	Had a spurious call to dslist in getnext, a silly mistake
F28	Bug in getnctok, forgot "macrocall"!
## While tracking this bug down, found out incidentally that kerning was okay.
## Also it correctly caught an error "0p" for "0pt".
F29	But there was a bug in scanspec (getnctok omitted after length)
D30	I had \hfill and \hskip conventions switched between table and program
L31	When scanspec put hsize on savestack it changed from real to integer
I32	In dumpnodelist when displaying rules, it's better to use * than -1.0
D33	Forgot to clear mem[head] to zero in pushnest, this caused the
		vrule link to be clobbered
I34	Although ligatures work, dumpnodelist needs to be careful displaying
		control codes
D35	Forgot to clear words off savestack in justend
## About 8 hours today

* March 13
B36	Needed to make hangfirst a parameter to justification, considering
		the "\hjust to ..." case
E37→36	Not really, so I removed it again: When hangwidth=0, hangfirst is irrelevant
## Time sharing is very slow today, so I am mostly reading technical reports
	while waiting THREE HOURS for compiler, editor, and loading routine.
## I'm not counting this as debugging time!
## (Came back in the evening.)
P38	Fixed comments in the justification routine, but the routine itself
		is almost working
D39	Variable ll was set 1 too high in many cases of justification
M40	"justbox" routine called justification wrongly: prevdepth not initialized
D41	Also curnode not reinitialized
M42	Also output was assumed to be in temphead instead of head
T43	Typo in freenode routine (linkd not llinkd) first caused a problem today
F44	Justification routine forgot to insert the insert list
F45	Bug in line breaking at glue node (s not set in one branch) [justification]
D46	Bug in "tricky" part of getnode routine, I used the info field instead of
		the llink field
## Now the "corners" macro of acphdr works
D47	Forgot to reset curnode after addtopage
T48	Typo (- for +) in computation of pageheight
S49	I got to ejectpage with curbreak=0 in one case, since badness was too bad
M50	delrclink should be a no-op when p=0 [actually it shouldn't, but
		one call forgot to make the test]
F51	scantoks didn't omit the initial { of output routine
I52	Inserted a comma to make typeout before page output look better
## About 7 good hours of debugging today. Tomorrow is first-output day (I hope).
* March 14 (Came in evening, slept most of day, to get computer at better time)
## Some day we will have personal computers and will live more normally.
## 8:30pm: Entered corrections to yesterday's problems.
I53	Added error message for non-character in filename or in font name
I54	Put "..." for omitted stuff in dumpcontext routine
## The following error was very hard to track down:
L55	"((n mod 10)+(...(...)) lsh infod)+p" didn't shift n by infod in insnum
## This made a spurious link field and sent hash[0]=\beta to the scanner!
## I could have found this bug an hour sooner if I had looked at the correct
	entry of recvrystack (I checked recvrystack[inptr-1] instead of ..[inptr]).
D56	Wrong page number on trace of pages before output routine
D57	I forgot to set savedpage←0 in \page routine, similarly in \box routine
I58	Forgot error message restricting \page to output routines
## Trouble with BAIL debugger bug, gives illegal memory reference and dies when
	single-stepping through the entry to recursive procedures hlistout,vlistout.
## So I have to reload and be careful to enter these procedures at high speed.
P59	Bug in comment (definition of srefs said ≥ not ≤)
B60	Typo in definition of outrule (said x,y not x0,y0)
B61	Embarrassing bug in shellsort, said "≤ str[k]" not "≤ t"
M62	The inputfile routine had improper interface with TEXOUT (leftover
		from older convention not updated to call declareofile)
L63	SAIL macro definition of newstring needs to have ( and ) inserted
M64	Parameters mixed with respect to outrule, the declaration was (x0,y0,x1,y1)
		while the call was (x0,x1,y0,y1)
## 4:30am, first page is successfully output!
## (It was "\titlepage\setcpage1\corners\eject\end".)

* March 15, 10:30pm
G65	eqdestroy needn't complain when redefining a TEX control code
## The first word of a paragraph won't be hyphenated...so be it.
T66	Typo in justification computed fa,fz wrong, so no hyphenation was tried
B67→25	Had changed glue to fillglue instead of zeroglue [justification]
## Today I'm instrumenting the justification routine and putting it through
	a bunch of tests.
## (The inserted instrumentation had bugs that won't be mentioned here.)
M68	Slip in call of hyphenate (forgot the "lsh infod")
T69	Typo (← for +) in computation of glueshrink
M70	\end did not end it, since I forgot that backinput uses curtok
S71	Used curwd for two things in trybreak, had to add the second parameter
F72	Kern nodes not properly accounted for in "s" computation during lookahead
		for hyphenation
F73	Blunder: forgot the case "< fa" in lookahead
D74	Also had mem[q] instead of prevbrk(q) in the reverse-linking loop
## (Getting feeble-minded?)
S75	Also I was wrong to think that eject was exactly like an infinitely
		negative penalty
G76	Decided to treat negative penalties differently
## 6:30am The justification algorithm appears to be working fine and efficiently.
## On small measures (about 20 characters per line), it gives overfull boxes
	instead of spaced out ones. Satisfactory.
* March 16, 9pm
## The plan for tonight is to test page breaking and more paragraphing.
G77	Inserted glue at beginning of page
I78	Added tracing '20 feature
## Had to put this feature into "inputfile" routine as well as getnext.
M79	In accent routine I had called vpackage with list ptr not list head ptr
## Checked for other lapses like that. Result, 14 calls OK, 12 NG.
D80	Also found one case where vpackage was improperly called with temphead
## Thus "holdhead" was born, also vpack and hpack.
## 11:30pm The machine is tied up again.
F81	Forgot that I had decided to allow char nodes in vlists after all
F82	Forgot to combine the page lists before pruning in ejectpage,
		so the pruning was aborted
B83	Typo in finishparagraph: fillglue not fillgluespec
I84	Added /q to xspool command (cosmetic change)
E85	Shouldn't have the form feed after the last page of output
## To fix this, I reorganized TEXOUT, and it became simpler.
T86	Typo: ← for + in the [vlist] case within hlistout
I87	Changed "completed page" message to "Completed for page"
B88	In addtopage I had used "gluespace(contrib)" (terrible)
P89	Inserted comment explaining the trick about botmark's reference count
S90	addtopage insnode was mixed up, it called testpagebreak after incrementing
		the totals, before contrib was changed
## I spent several hours tracking down the following data structure bug:
F91	After overflowing the variable memory, control fell through to found
		instead of going to ovfl
B92→7	newline hadn't been changed to nextline in declarofil
S93	\eject in paragraph didn't work with really bad breaks
## Noted problem to be diagnosed tomorrow: Each time I ran the test program,
	the amount of memory in use grew by 13 cells not returned.
## 7 hours tonight.

* March 17
G94	Invented "deadcycles" to keep \end active until shipout occurs
E95	Decided not to call justification with an empty list
S96	Lastwidth was computed wrong in justification, due to paragraph fill glue
E97	Third parameter added to hpackage, avoids improper calls to justification
L98	Found out that fillglue in middle of paragraph will upset the justifier,
		inserted warning message
## Spent an hour looking for a bug in TEX, but the following one was in METAFONT:
## xgpheight data in fonts had been supplied wrong.
## It took two hours to recompile 32 fonts with METAAFONT0.
R99	During this time I also made tracedump and dumptokens more robust
		to software bugs
F100→97	In new hpackage, must not remove eject nodes when trial is true
E101	Put fast exit into hpackage, e.g. at glue nodes "if trial and (curwd > ...)"
## 2am, I have to go to bed "early" tonight.
* March 18 (Saturday), 3:30pm
I102	Change "showmem" to "checkmem" (which compares not displays)
G103	While fixing insnode routine the need for maxdepth occurred to me
		(making a third parameter necessary in vpackage)
G104	Introduced a parameter for justification: 2.0 becomes justparam,
		to be set like tracing
D105	Discovered that the 13 extra nodes not returned to memory are eject nodes
		removed during justification
## The initalign procedure worked right the first time!
## Also startalign, startunsetnode.
S106	But endv in a token list violated my comments in TEXSYN p8, thus endv
		(code 42) got changed to code 10 (spacer).
S107	In delimited macro call, I lost the fact that a right brace had appeared
		(so prevcmd was added)
## The following big mistake was now detected:
F108	I had not put ⊗ and \cr routines into the getnc scanner,
		only in bigswitch, so they lost out big
I109	Also needed more error checks on endv, e.g. not occurring in
		a macro definition or call
## All this involved major surgery, including renumbering lots of codes,
	revising dumplist, rerunning TEXPRE.
S110	The new program still failed; that's when I first realized the hairiness
		of alignment (e.g., "\halign{\u#\v⊗..." when \u and \v are
		defined to include ⊗'s...)
## I decided to solve the problem in a `simple' way by considering only whether
	an alignment is currently active.
## 11:30pm, Went to bed.
* March 19
## Woke up with `better' idea on how to handle ⊗ and \cr.
## (Namely, to consider a special kind of \def whose parameters don't interrupt
	on ⊗'s and \cr's).
## But replaced this by a much better idea (to introduce alignstate).
## 11pm, Began to use computer.
## Major surgery (inserting alignstate and updating the associated routines
	and documentation)
D111	Discovered that endalign failed to pop the align stacks
T112→110 Typo in dumpcontext (newly inserted bug)
F113→110 Must set alignstate false in aligndelim routine
I114	Must change aligncode error in rbrace routine
D115	Glueset was forgotten in finishunsetbox
## I had a mistake in my definition of \quoteformat for acphdr, also extra spaces.
## My first test programs, used before today, were contrived to test macro
	expansion, justification, and page layout.
## Next I'm using a test program based on volume 2.
G116	Made carriage-return equivalent to space and tab in macro matching
I117	Mark node was not dumped correctly (should omit reference count)
B118	Slip, "typed" instead of "valued" in penalty routine
S119	Went to "addtopage" not "bigswitch" in noindent routine(!)
## I had undesired spaces coming thru the scanner in my macro definitions
	of \tenpoint, etc.
## 4am, TEX now knows enough to set page 1 of volume 2.
## Also it did its first "math formula" (namely $X$) without crucial error.
## (Except that the italic correction was missing.)
D120	curlev wasn't decremented in endalign
D121	curlev wasn't incremented in error exits of rbrace
T122	Typo in error message for mmode+mathbr
R123	Made dumpnoadlist more robust and more like the new dumpnodelist
L124	Typo in boxchar: should say fmemreal
T125	Typos in definitions of defaultrulethickness, bigopspacing (7 not 8)
D126	I had hyphenate backwards [turned hyphenation on just before math,
		and off just after it!]
## 7.5 hours debugging today. Got through the test program a little more,
## But blew up on $Y+1$; tomorrow I hope to find out why.
* March 20, 8pm
## I decided to work next on a super-hairy formula.
G127	Changed "\ascii" to "\cc" (character code)
S128	At beginning of $$ there's no need to store a penalty node when lines=1,
		since it has already been stored
D129	addtopage should not refer to curnode when nestptr>0
B130	Slip in mathinput routine (valued for typed)
B131	Mental lapse in above routine, had "operand" instead of "aboverule"
F132	Forgot to extract 9 bits of curchar in mathonly case of scandelim
G133	Decided to allow optional space after \def{...}
## My test example is so complicated it causes the semantic stacks to overflow.
I134	When no pages output, should not prompt "xspool" in TEXOUT (I had
		improperly used ochan to decide this)
T135	Typo in definition of mathop (opennoad not opnoad)
S136	"\left(...\above...\right)" didn't parse correctly (the \left got into the
		numerator, the \right into the denominator),
		so I rewrote finishmlist
F137	Discrepancy in dumpnoadfield testing of threshold, so simple fields
		got dumped with others looked empty
I138	Forgot <cr> before typeout in inputfile routine
M139	Called tracedumpmath(mem[..]) instead of tracedumpmath(...) in
		the incompleatnoad case of dumpactivities
## 3am, Now the whole messy formula is parsed correctly into a tree.
## The easy part is done, now comes the harder part.
F140	Opnoad case of evalmlist shifted box down for nonsingle characters
B141	Crazy goof: the boxfield procedure forgot to make a box node,
		it returned an hlist instead
## Font info had the wrong value of "quad".
S142	rebox procedure should not throw away the italic correction; I decided
		to make glueset ≠ 0 a flag for this
D143	In rebox I had setfield(value,p,q1) not ...mem[p]... so it bombed
## 6am, 10 hours today. It didn't do "$\pi\over2$" correctly, but was close.
## I found that the rebox problem went away when I fixed the boxfield problem,
	but decided to leave the extra stuff about glueset ≠ 0 in the program
	anyway, just for weird cases.
E144	Changed boxfield for efficiency so that an extra level of boxes was omitted
## (Thus the rebox problem would have had to be faced anyway.)
* March 21, 10pm
## The computer is rather heavily loaded tonight.
B145	sqrt calculation: again I forgot "aboverule"
L146	Forgot to make p local to abovenoad routine in mlist_to_hlist,
		with disastrous effect
I147	dumpnodelist: omit glueset if 0
G148→142 Make glueset nonzero in varsymbol
F149	mathglue procedure forgot to return its answer
T150	Subscripted P was same width as unsubscripted: this was due to
		a typo in boxchar (c not w)
E151	Added cleanbox procedure because of new rebox approach
D152	This also avoided another bug e.g. on \sqrt{\raise...}
G153	Changed definition of \not in TEXPRE so that it is a relation
		(thus will butt against the following relation)
I154	In varsymbol, gave error instead of "confusion" since the error can occur
F155	Also changed the use of p since it wasn't always set on entry
		to charfound [in varsymbol]
## Another font problem: mathex didn't compute TEX info in machine-independent way.
## It took two hours to correct this.
D156	The varsymbol code forgot to set mem[b] to the node type, in one branch
B157	packagehlist treated shiftamt with wrong sign
B158	Kern not used when there's no superscript
L159	Had spacetable declared as [0:7,0:7] not [0:6,0:6], so its
		entries preloaded into the wrong positions
S160	The test p=0 in varsymbol had to be changed to p<0
G161→127 Changed \cc to \char
B162	In mlist_to_hlist when changing q to a boxnoad, can't use subtraction
B163	Two typos in spacetable (0 for nospace)
B164	Forgot to initialize cursize (two places)
S165	Incorrectly reset binnoad before opnoad
F166	evalmlist opnoad case asked for curstyle=dispstyle,
		not (curstyle land 3)=dispstyle.
B167	Also it didn't shift the character correctly in the non-dispstyle case
## Still another font problem: The ms table was wrong because msarry was
	declared type real in mathex procedure
B168	In varsymbol, should use depth instead of height
G169	Accent routine should provide for accent in slanted font
## At this point I think nearly all the math formula routines have been exercised.
## Tomorrow they should work!
## 8 hours debugging today.
* March 22 (Wednesday)
## (Actually Thursday: I began at midnight due to proofreading a paper.)
G170→169 Decided that accent routine should NOT consider slants after all,
		since slanted math letters are put differently into fonts
B171	Slip in accent routine, can't use variable q
## I checked out the font access tables, slowly (i.e., mathdecode and
	TEXPRE entries were catalogued).
F172	Bug in compactlist (forgot q←s)
M173	Both varsymbol and mlist_to_hlist wanted to use temphead simultaneously
T174	Bad typo in overbar routine (b for p)
## Finally got to finishdisplay on the hairy formula...
T175	Typo: p for b this time
L176	Extra parentheses needed (twice) because of lsh precedence
M177	hangbegin not handled right since conventions changed
G178	Recomputed penalties so that break after punct is allowed
F179	Forgot to center large delimiters
G180	Should round rule sizes (up) before drawing them
G181	Need more space over x in sqrt x, and more space atop vincula
G182	Made large delimiters large enough to cover formula height
		(important for subscripts, superscripts)
I183	Inserted /ntn=33 on xgp prompt message so that complex math will print OK
P184→161 Changed \char comment in TEXHDR and TEXSYN
## Six hours today.
* Maundy Thursday March 23, 11pm
G185→104 Decided to make \trace and \jpar follow block structure
## Entered corrections found yesterday (this took two hours,
	because of numerous changes).
M186	topbotmark routine had wrong call on insrclist
## Now the formula looks like it should, modulo problems in fonts.
G187	Exponent should never get below baseline + xheight/4
B188	Typo: quad for qd in finishdisplay (several places)
S189	When putting eqnobox on separate line, shouldn't use append,
		as page shouldn't break at glue there
S190	Need bigger input stacks due to backing up
S191	In ejectpage should not change to zero glue,
		since curbreak won't point to glue node except on eJect
M192	Should use epsilon in scanspec (I had used a different small constant)
I193	scanrulespec should not allow negative lengths or zero lengths
		(added scanposlength)
B194	Bad loop in leaders routine of vlistout:
		I had the initialization INSIDE the loop
L195	Had two temp variables named h, one real the other integer
F196	Forgot to put leadernode into hlistout lookahead routine when I
		added the leader feature
F197	Forgot to compute x0 in variable horizontal rule
## 7.5 hours today. It seems to be ready to tackle my test file based on Volume 2.
S198	Should calculate y00 in horizontal rules using integer from baseline,
		so that baseline doesn't jump

* March 25, Saturday, 2am (might as well drop Friday)
M199→185 The way I redefined \trace made chcodedef think I erred
F200→185 Also it forgot to check index
F201	I forgot to reset alignstate at beginning of initalign
F202	Forgot scanlb in noalign
## Big bad bug that took me 3 hours to find (since I thought this part was working):
D203	Need to set hashentry←-1 in getnext after \cr causes switch to aligndelim
## Note to myself: I KNEW it would be cleaner to define getnext so that it sets
	hashentry←-1 each time it begins, but I avoided this on grounds of
	efficiency in the inner loop. Well, now I have earned this tiny bit
	of efficiency.
D204	First word of a node came out negative
## That was another bad one, it's not my night.
B205	At topbotinsend I forgot that savestack entry was negative
F206→104 Have to initialize jpar
B207	Diagnostic dump didn't handle insert nodes properly
I208	Need to stop dumplist from building really long strings when in a loop
D209	Need to increase refcount of botmark when vpackage finds it
S210	I forgot that the tokenlist for mark ends with a }
D211	The top insert was lost...problem is in vpackage
S212	Even if it had worked (the stupid code fails when first elt is a topinsert),
		it would have been last-in-first-out!
## 7 hours today.
* Easter Sunday March 26, will work till sunrise
I213	I added the "i" feature to the error routine, and made dumptokens
		still more robust
I214	Included a prompt, and deleted `c←...'
G215	Should omit space after \noalign{...}
## Otherwise, I'm finding more bugs in my test program than in TEX so far tonight.
## The "i" feature is proving to be very helpful.
## Needed to increase size of mem (now varsize=3500, memsize=10000).
## Needed to increase size of mem (now varsize=4500, memsize=11000).
I216	TEXPRE should output varsize for error check
S217	Size of delimiters was calculated wrong (should be based on the
		distance from the axis, not the baseline)
## Having trouble with a SAIL compiler bug. Rearranged program until it
	compiled correctly. I hope the bug isn't more severe than it appears.
S218→210 Shouldn't go to newsavelevel if botmark=0
## I had to redo the typewriter style font since its width tables were wrong.
## Increased memory size again to 5500 then 6500.
## Finally the entire test program was TEXed. Happy Easter! Six hours today.

* March 27, beginning 2:30am
S219	The vcentering was done in second pass of mlist_to_hlist,
		but this meant that height, depth, subscripts, etc. were way off
S220	Omitted space after closing $$
## Spacing was wrong in $Y↓1+\cdots+Y↓k$; I have to rethink the use of three dots.
G221	Made thspace available to user as \≤
G222	Introduced \dispaskip and \dispbskip
## Need to test justification with embedded math formulas.
I223	The "Whoa" error should set stopping_on_errors←false
B224	Big mistake in stylenoad routine (ptr to a glue spec not glue itself),
		somehow didn't cause trouble yesterday
G225	Changed fntfam to follow block structure (i.e., deleted mathfonttable
		and extended eqtb)
## At this point the test deck works perfectly.
## But I will change page width in order to check harder cases.
G226→178 Had wrong penalty for punct nodes (e.g., consider $f(x,y)$)...
		in fact, I decided to disallow it after all
S227	Italic correction should be box, not glue, so as not to be broken
## 8 hours today.
D228	Had clobbered memory by calling freeavail instead of freenode in the
		[insnode] case of vpackage
* March 29 (Wednesday), beginning 2:30am
G229	Want still more space above and below fraction lines in displayed formulas
G230	Need an infinite penalty feature, and should use it in displayed formulas
		whose eqno doesn't fit
S231	After finishdisplay, I didn't go to addtopage;
		and shouldn't go to noindent because of the next remark
S232	parskip glue should come just before paragraph, not after
		(as it interferes with a penalty after)
## After the test program had gone through correctly, 46 more locations 
	of dynamic memory and 280 of 1-word memory had not been freed.
D233	Found the omission in endalign, forgot to free ulists and vlists
B234	Bug in finishparagraph: delgluelink(curnode) not delgluelink(value(curnode))
## There's also a more mysterious bug, an abovenoad corresponding to
	{p\choose (null)}, an incompleatnoad not completed.
## Couldn't find that one, fixed other errors first.
## Now it gains 10 locations of dynamic memory and seven of 1-word memory.
I235	searchmem should search eqtb also
D236	I found the seven 1-word nodes: They were inserted by rebox when
		value(p)=0, and put onto a linked list starting with mem[0],
		growing at the far end(!)
D237	I found the incompleatnode: My test output was wrong, as I had never
		noticed that $p\choose k$ came out as "k"
## This worked... I feel that TEX is now pretty well debugged (except perhaps
	for error recovery)---it's time to celebrate!
Summary of initial debugging stage:
	March	Time (hours)
	10	6
	11	7
	12	8
	13	7
	14	8
	15	8
	16	7
	17	7
	18	8
	19	7.5
	20	10
	21	8
	22	6
	23	7.5
	25	7
	26	6
	27	8
	29	6
     ------   -------
   18 days    132 hours   7.3 hours per day on this project

    237 changes logged   (1.8 per hour)
* April 1
I238	Improved error recovery (not quitting after file lookup failed)

* April 2
P239	Added "libraryarea" to specify default library area associated with device

* April 3
T240	Had never tried hmode+discr before; had typographic error there
R241	Error recovery on parameter #n with n out of range,
		I forgot that backerror requires gettok

* April 4
I242	Decided to add deletion feature to the error routine

* April 5
G243	Reset spacefactor after italcorr and after $...$

* April 10
G244→104 Make chpar instead of jpar; this handles trace, jpar,
		and penalties for hyphens, relations, binops, widows

* May 14
G245	Decided that $ $ in text should end with spacing as if it were
		followed by punctuation
F246	Had left \times out by mistake
G247	Changed Scandinavian accent names

* May 17
B248	"\halign to size" used vsize instead of hsize

* May 19
G249	\topbaseline feature added
G250→245 The $ $ feature of May 14 subtracted
S251	scanmath procedure should skip blanks
I252	Error recovery in mmode+mathbr, when savestack had "endscanmath",
		was bad: added "missingbrace" routine
G253	Changes to math spacing after a "close"
G254	Underline needs to be further under
S255→96	Got wrong setup when displayed equation follows paragraph with
		fillglue removed

* May 20
S256	In alignment had spurious value of prevdepth
## The next bug was more subtle than usual:
S257	I had used temphead in building u,v lists in initalign; then in scanning
		"\tabskip 2pt\rt{...}" the macro \rt was expanded,
		clobbering temphead
G258	Different spacing needed for \atop (added "num3" parameter)
G259	\comb should use fixed size delimiters

* May 22
G260	Changed \≤ to \≥ and introduced negthspace \≤
I261	dumpnodelist: penalty nodes didn't display negative values
## The memory overflowed varsize=7500 with memsize=16192. So I have to go to
	15-bit pointers. (A problem on 32-bit machines?)
* May 23
G262	Should put space above and below limits of big displayed operators
T263	Typo in $$\halign{...}$$, something never before tested
D264	Forgot to release channel in lookup-failure recovery
I265	Improved error recovery for "extra ⊗" in aligndelim
R266	top piece must be calculated mod '200 in varsymbol (to guarantee
		the subscript range)
B267→252 Bug fixed in new missingbrace code
B268→262 Bug fixed in new code for limits on display operators

* May 26
G269	Math shouldn't insert a penalty after an explicit penalty
## Hash table overflowed, have to make it much bigger.
R270	Avoided possible bad memory reference in alignment
		when alignrecord<0 and erroneous input
G271	Realized that hsize, etc. must be global variables so that they can
		be set in \output routine
## This led to major simplifications in TEX, also to major surgery.
D272	Bug in \end routine, forgot to set mem[curbox]

* May 27
## Overflowed memory again, both varsize and memsize, in Sec. 3.3.2.
R273	math mode \char didn't mask off enough bits
B274	negopspace was wrong

* May 29
S275	getnctok with undefined control sequence, this case was not anticipated
F276	Single character raised had wrong superscript shift
R277	Character code must be cut to 7 bits in \char routine,
		to avoid sftable out of range
## More memory capacity overflows.
I278	Fix overflow stop so I don't have to wait for loading of BAIL debug routines
I279	When page ends in mid-macro, the page number wasn't adjusted

* June 5
R280	In TEXOUT, newstring(x0,y0) should mask its argument to ensure their range
I281	Overfull box error should give more information

* June 7
G282	The varsymbol code for builtup symbols had > instead of ≥
		for its termination criterion
G283	+eject disallowed in mmode
G284	\sqrt in text mode had too much clearance

* June 9
G285→110 Decided to make alignstate an integer variable,
		so that \eqalign can be within \eqalign
G286	\mark is to expand its input

* June 10
E287	Worked out a way to avoid font loading each time
I288	Should close print file before switching to edit the input file with
		the "e" option
D289	mem[inserts] should be returned to free storage when not used
G290	underbar and overbar weren't consistent with each other
* June 18
D291	Serious error in rebox (used b instead of value(b)) surfaces
		for the first time!
G292	Removed \deg from TEXPRE
G293	Added extra hyphenation penalty for two in a row

* June 19
I294	scanmath followed by an undefined control sequence clobbers the save table;
		so "nonewcontrolseq" was added

* June 20
L295	Floating point hurt in badness computations; "glue≤0.0"→"glue≤0.0001"
L296	Also badness was forced to be at most 10↑19
I297	Added \endv for error recovery
E298→287 My simple scheme for font preloading left thousands of "dead" words
		in memory, so I introduced initfnt in TEXPRE
E299	Learned how to economize disk space by internal arrays in load
		modules not being reinitialized
E300	Moved mem to TEXSEM where the object code will be more efficient

* June 21
## Made several changes while writing the user manual:
G301	Disallowed hmode+innput, mmode+innput
I302	Added mmode+endv, mmode+parend error recovery
G302	Generalized \ifT to \if T

* June 22
F304	"bullet" left out of TEXPRE
D305→256 Alignment didn't start with correct prevdepth
S306	Changed ejectnode so that it ejects only once

* July 14
I307	If file isn't found, will look in standard area for it
I308	Echoed inputs in errors file

* July 19
## Adjustments to math positioning of fractions and subscripts in unusual cases:
G309	Equalized spacing when only one of numerator/denominator was big
G310	Prevented subscript from getting too high above baseline
R311	pushinput should say "if inptr≥stacksize and pausing_on_errors",
		to avoid infinite loop

* July 22
G312	Should make \quad defined outside math mode (means all fonts change again)
I313	dumpactivities should end by telling the nesting level
G314	Put in Op space, changed vector accent to "\b"

* July 25
G315→94	Null pages created at \end should have the correct hsize and vsize
S316→94	Also they shouldn't be "appended"
I317→297 Control sequence \endv is removed, since error recovery is now better
I318	Trace bit '40 defined: puts `OK' on \ddt
G319→244 Fix defaults of parameters
I320	Made tracing depth several bits wide
I321	mmode+above: if incnoad≠0 should scanlength or scandelim sometimes
R322	Accent <number> should reduce mode 128 or 512 depending on the mode
I323	Improve typeout for "(end occurred on level ...)"
* July 28 (while writing Chapter 27 of the manual)
I324	scandigit error: changed message to "Missing digit (0 to 9), 0 inserted"
I325	Overfull boxes reported only for > .1 point
I326	scanfont should give a chance to define the font, twice
R327	Default for bad parameter number changed from #1 to ##,
		since #1 wouldn't always work
I328	Omitted the "Negative?" message on things like \chpar
I329	Large delimiter should be in mathex: recovery sets delimiter from c1 only
I330	$\right should not say "Missing $"
I331	backerror should call backinput before the error message, not afterwards

* August 1
I332	When there's no input file and user types "e", give a message
D333	Need to increase system pdl so that the manual will compile

* August 2
G334	Decided to make \ragged a parameter
G335	Omitted "widow penalty" for one-line paragraphs

* August 5
G336	Need to generalize cpage to \count<digit>
F337→285 Extra } and Missing {: on error recovery, need to update alignstate
I338	`use of' gives `runaway argument' message

* August 22
G339	Added disppen parameter
I340	Improved punctuation on error messages

* August 23
R341	`Missing \cr' error message failed, inserted the branch to extrarb
I342	dumpcontext should go past insertions
G343	No penalty for break one line before a display
I344→338 End of last page should check runaways
I345	Need error message when argument begins with }

* August 24
I346	Remove extra line-feed in dumpcontext after printing insertions

* August 25
G347	No glue at top of page, even after \eject

* September 1
G348	leadernode should not be passed over in trybreak
G349	Penalties not allowed at top of page

* September 4
I350→338 Included \ in error message after runaway argument

* September 8
## Increased the size of ligature field, remade all fonts.
B351→349 I had left out a "go to" statement in first branch of new penalty
		routine in addtopage
* September 30
S352→338 Runaway argument ended with "\lcm" (in hashtable location 0):
		Need to make itm global
R353	Got in loop with missing $ message: was result of $$ in
		restricted horizontal mode, bad error recovery
B354	Two bugs in the hyphenation routine with respect to -ages, -ers
G355	Added -est to hyphenation routine
G356	Also disabled puz-zled and rat-tled, etc.

* October 4
G357	Added \vtop
S358	Proper treatment of kerns following characters ending with "-"

* November 4
G359	Centering displayed equations without equation numbers shouldn't
		include half quad at left and right

* November 11
D360	Postamble must not be empty

* November 15
G361	Decided to allow optional space after digit in scandigit routine

* November 17
R362	Made checkmem procedure slightly more robust

* November 20
G363	\par in \def should match \par that comes automatically
G364	New parameter gives spacing before and after equations in text
G365	\advcount .. by ... extension

* November 25
G366	\unskip extension
G367	\uppercase and \lowercase extension

* November 28
D368→338 \mark when reading end of page has no warning after macrocall
I369	dumpnodelist shouldn't print } after \mark
G370	\xdef extension

* November 29
S371	\else{ } followed by space, the space wasn't deleted in the false case
B372→320 \tracing doesn't set levels, etc., as advertised
S373	justification didn't treat kern nodes properly [curwd not updated]
F374	Math kern node not deleted at beginning of line
D375	\disppen 1000 didn't suppress page breaking

* December 6
I376	Changed file opening statement to allow lines up to 150 characters long
* January 16 (1979)
B377→365 advcount: forgot to reset nbrsign

* January 20
R378	alignment: complex preambles need to be more robust,
		they crashed the program

* February 17
I379→376 Warning on long line broken should give more info
L380	In the rare case of trybreak, integer p was left out
S381→334 Ragged correction not made when last line line of paragraph had to shrink

* February 22
B382→363 getnctok forgot to return after finding \par
G383	\lineskiplimit added
G384	\hbox par replaces \hjust to ...{overfull}
G385	\hbox and \vbox are the new names
G386	\ifpos added
G387	vu and \varunit added
G388	em unit added
G389	negative \hbox expand ... now legal

* March 10
G390→370 scantoks now expands \count during \xdef

* March 23
G391	End of paragraph now 100000 stretch instead of 10000000000
G392	Last line of paragraph treated more consistently with the whole
		paragraph (e.g. when stretch glue appears in mid-paragraph)

* March 31
S393	<glue><penalty> can in weird case be consecutive breaks in a paragraph,
		so I have to ensure that that penalty isn't wiped out

* April 27
D394	Page number count was wrong if a file began with an empty page
G395	The mathdecode table was made changeable via chcode
I396→332 If not inputting from a file, "e" not accepted after error message

* May 29
D397	inputfile: in one case of error recovery an extra popinput was done

* June 7
S398	When eject came just at the time another break was preferable
		(e.g., page just became too full) it didn't eject at both places

* June 27
I399→353 In restricted horizontal mode, $$ gives the
		error `You can't do that in math mode'!

* June 30
G400	Added wd, dp, ht dimension units
I401→307 When file extension is explicitly given, don't try area [1,3]
		if unsuccessful
* July 1
G402	Added letters as numbers

* July 2
S403	\gdef bug: If the control sequence was never defined before,
		TEX removed it at block end

* July 16
B404→320 tracedumpmath updated to be like tracedump (inconsistency was
		introduced by prev change to tracedump months ago)

* July 18
G405	Extended capacity to 64 fonts if desired
G406	"extraspace" parameter added to fonts
B407	nodenoads didn't print correctly in tracedumpmath
G408	Made jpar allow any break if it is ≥1000000

* July 23
G409	\hfil etc. added
G410	\ifmmode added
G411	\firstmark added
G412	Decided to allow break at leaders (horizontal mode only)

* July 25
R413→213 An insertion following an end-of-file error didn't work
B414→411 Fixed a bug introduced July 23 ("if firstmark" should have
		been "if firstmark≥0")

* July 28
G415→370 \xdef now doesn't expand control sequences after \def's
I416	Changed symbolic printout for one-letter identifiers
I417	The errors.tmp file now avoids linefeeds
G418→370 \xdef now expands \topmark, etc.

* August 4
B419→412 Corrected error introduced July 25, \par was suddenly
		omitted at end of page

* August 11
I420	Changed error messages that involve "⊗" character

* August 28
B421→411 firstmark←-1 in vpackage, should have been done in ejectpage
S422	Serious gdef bug: Since control sequences don't obey last-in-first-out
	discipline, I had to either restrict the language (requiring \gdef'd
	ones to be defined on outer level before being redefined) or change the
	hash table algorithm. Although all applications of TEX known to me would
	agree to the former, I did the latter, since it also improved the
	language (arbitrary-length control sequences now recognized).
B423	While fixing that I noticed one case where unsave called eqdestroy
	with a value from the upper part of eqtb; this long-standing bug had
	low probability of causing trouble (e.g., required a certain field of
	a floating-point number to have a certain value), but would have
	been devastating on the day it showed up
F424→411 Also noticed that eqdestroy not called in case where some control
		sequence was \def'ed and then \gdef'ed
S425→418 Inconsistent treatment of first token when \topmark, etc. was
	expanded in scantoks
* January 25, 1980
I426	Page warning error inserted within alignment preambles
G427	New one-character control sequence feature

* February 7
F428	Op space \> was never implemented in math mode

* February 25
G429	new dimension "ex" for xheight

* March 3
G430→427 \: can now be redefined (so : can now be type 13)

* March 23 (An extend-TEX-for-the-eighties party)
G431	new \copy feature
G432	new \unbox feature
G433	new \open feature
G434	new \send feature
G435	new \leqno feature
G436	new \ifdimen feature
F437	\<space> in vertical mode should begin a paragraph
G438	new \font feature
G439	new \parval and \codeval feature
G440→427 one-character control sequences shouldn't gobble the following space
G441	new dumplength parameter
G442	new \linebreak feature

* March 25 (still working on the above, also thought of more)
G443	new \mskip feature
G444	new \newname feature (later called \let)
G445	allow any control sequence to be redefined
B446	output file name shouldn't be on user area

* March 27
B447	xheight for accents in math mode should come from rm not sy font

* March 28
B448	increased minimum clearance between subscript and superscript

* March 29
G449	display following a display, the second will have dispaskip glue

* April 4
F450→445 improper recognition of \tabskip in alignment preambles

* April 23
I451	At SUAI, compute length of output for the new XGP server priority feature
I452→434 At SUAI and MIT, \send output > 150 chars to be broken into pieces

* May 19
I453	\left and \right now need to be only 90% of the enclosed size.

* May 21
G454	added \pagebreak feature
* June 13 (Begin overhaul of justification routine and miscellaneous goodies)
G455	allow radical sign to be in different font positions
E456	clear empty tokenlists off input stacks to allow deeper recursions
G457	\spaceskip and \parfillskip made changeable
G458	rfudge is made a parameter (per request of Zippel)
G459	\chpar and \chcode will not ignore signs (new \loose parameter can be < 0)
P460	"justpar" removed

* June 14
G461	new justification routines installed (major changes to TEXSEM p13)
G462	new parameter exhyf

* June 16
B463→444 had eqdefine(...skiploc,assignglue,...), assignglue should've been glueref
B464→444 would expand \b in \xdef{\α\b{...}} after \let\α=\def
B465→444 did not unsave things in the "locs" area properly (left dead storage)

* June 17
G466	decided to allow negative dimensions in rules

* June 19
B467→465 incorrect change in idname routine, range test should be at outer level

* June 27
I468→453 \left and \right shouldn't be too small for e.g. big matrices

* August 3
G469	Numbered equations are not put flush left unless they begin with glue

* September 15
B470→461 said ">fz" instead of "≥fz" iN linebreaking routine (forgot def od fz)
R471	range oF index in chcodedef should be checked before saving old value

* September 18
D472→457 fkrgot to increase the reference count to \parfillskip

* September 19¬
B473	Leaderq should break like glue in both horizontal and vertical modes
B474→364 "mathsurround" didn't break properly at left and right end of lines

* October 13
S475→461 removed spurious overfull boxes generated when looseness criterion fails
B476→461 choice of breakpoints in presence of looseness iterated badly
G477→461 avoided storing a lot of breakpoints when they are dominated by others
B478→366 said "field(value,curnode)" instead of "field(value,mem[curnode])"
I479→461 on = totalbadness, now prefer the oldest break rather than the youngest
I480→461 when forced to make overfull box, don't make badness too much for floating

* December 10
I481	Made it impossible to get unmatched "}" in a delimited macro argument
G482	Added \topsep and \botsep features

* January 6, 1981
I483	Major conversion to .tfm files instead of .tfx files
I484	If not pausing on errors, aborts after 100 errors
G485	New \spacefactor and \specskip and \skip primitives
G486	\unskip now allowed in restricted vertical mode

* January 26
B487→482 I said value(mem[q]) instead of value(q)

* February 27
I488	More linefeeds in the errors.tmp file will prevent overprinting in listings
G489	\dpenalty feature added
G490	New dimension cc
G491	scanstring now matches uppercase letters too
I492	Nonstop mode added so that overnight batch processing is possible

* March 2
S493→422 Just realized that \gdef makes it bad to forget control sequences, ever
I494	Warning message at end of page if nesting level isn't zero

* March 5
I495	Memory statistics now keep track of maximum usage
G496	Glue and penalties at top of page deleted after marks, sends, inserts
G497	\mark now allowed in horizontal mode
G498	space is allowed before required left brace, e.g. \if AA {...}
I499	Incomplete \if error will catch bad \ifs better

* March 17
I500→494 Warning message at end of page if nesting level changed on that page
S501	Spacing looked wrong when there was a very tall subscript with a superscript

* March 20
B501→371 Space eating after \else made consistent between true/false cases

* March 24
D502→496 Forgot to change gluespecsize to insspecsize in vpackage procedure

* April 5
T503→501 Had + instead of -, shifted certain subscripts down instead of up

* April 18
F504	Leaders with rules of specified size should be like variable rules

* April 29
S505→461 Don't consider badness>threshold at \linebreak except in emergency

* July 13
G506→402 Added other characters as numbers
S507→294 Dead storage avoided if nonewcontrolseq error occurs
G508	\ifx added
G509	\xleaders and \cleaders added

* July 14
B510→506 Constant like ".5" treated wrong ("." thought to be '056!)
L511→506 Code added at end of procedure was ignored since earlier line "return"ed

* August 4
I512	Error recovery can use letters instead of line feed, form feed, etc.
G513	Added "\thebox" feature

* August 7
G514	Added "fil(l)(l)" glue dimensions
S515	Don't give overfull box error when shrinkage amount is negative

* August 9
G516	in alignments, the unset boxes should inherit size of their parent

* April 12, 1982
F517	TEXPRE didn't write out the dsize array (needed by TEXDVI module)

* May 1, 1982
S518	boxfield error, evalmlist could make link(b)=0 and type(b)=gluenode